<template>
  <div>
    <el-button type="primary" @click="AddOneArticle()">发布文章</el-button>
    <el-button type="primary" @click="updataOneUser()">更改账号密码</el-button>
    <el-button type="primary" @click="outUser()">退出</el-button>
    <el-button type="primary" @click="test()">测试</el-button>
    <el-row type="flex" class="row-bg" justify="space-between">
      <el-col :span="6"
        ><div class="grid-content bg-purple">
          <el-button type="primary" @click="queryAllArticle()"
            >查询全部文章 {{ this.$store.getters.getUser.name }}</el-button
          >
        </div></el-col
      >
      <el-col :span="6"
        ><div class="grid-content bg-purple">
          <el-button type="primary" @click="queryToken()">查询token</el-button>
        </div></el-col
      >
      <el-col :span="6"
        ><div class="grid-content bg-purple">
          <el-button type="primary" @click="setUser()">更改信息</el-button>
        </div></el-col
      >
    </el-row>
  </div>
</template>

<script>
export default {
  name: "UserPage",
  data() {},
  methods: {
    AddOneArticle() {
      this.$router.push({ path: "/article/addOneArticle" });
    },
    test() {
      this.axios({
        headers: {
          Authorization: window.sessionStorage.getItem("userLogin"),
        },
        method: "post",
        url: this.$constant.url + "/user/test",
      }).then(({ data }) => {
        console.log(data);
      });
    },
    outUser() {},
  },
};
</script>

<style>
</style>